home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group96a.txt
/
000016_icon-group-sender _Tue Jan 16 10:08:39 1996.msg
< prev
next >
Wrap
Internet Message Format
|
1996-09-05
|
1KB
Received: by cheltenham.cs.arizona.edu; Tue, 16 Jan 1996 12:30:29 MST
Message-Id: <m0tc6vz-000PYzC@ns1.computek.net>
Date: Tue, 16 Jan 96 12:10 IST
Mime-Version: 1.0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
From: gep2@computek.net
Subject: Initializing tables
To: icon-group@cs.arizona.edu
X-Mailer: SPRY Mail Version: 04.00.06.17
Errors-To: icon-group-errors@cs.arizona.edu
Status: O
> aTable := table()
every entry := ![["bob",2],["sue",5],["fred",12],["mary",9]] do
aTable[entry[1]] := entry[2]
For SNOBOL4+/SPITBOL, Gimpel proposes something like the following:
dd = "0123456789" ;* define decimal digits
atable = table()
tinit = "bob2sue5fred12mary9"
initl1 tinit fence break(dd) . name span(dd) . num =
+ ?(atable[name] = num) :s(initl1)
If you have many large tables that you need to initialize this way, and in a
program you intend to use many times, it can be helpful to go ahead and save the
executable/intepretable to disk AFTER this preliminary execution stage is
finished.
Gordon Peterson
http://www.computek.net/public/gep2/